loadAd

fun loadAd(adRequest: AdRequest, listener: NativeAdLoadListener)

Start loading the native ad on a background thread.

Parameters

adRequest

an AdRequest object contains targeting information used to fetch a native ad.

listener

NativeAdLoadListener to be invoked when the ad is loaded or loading fails.


suspend fun loadAd(adRequest: AdRequest): NativeAdLoadResult

Start loading the native ad on a background thread.

Return

NativeAdLoadResult.Success with NativeAd or NativeAdLoadResult.Failure with com.yandex.mobile.ads.common.AdRequestError.

Parameters

adRequest

an AdRequest object contains targeting information used to fetch a native ad.


fun loadAd(adRequest: AdRequest, options: NativeAdOptions, listener: NativeAdLoadListener)

Start loading the native ad on a background thread.

Parameters

adRequest

an AdRequest object contains targeting information used to fetch a native ad.

options

Configuration options for native ad loading. Default options load images automatically.

listener

NativeAdLoadListener to be invoked when the ad is loaded or loading fails.


suspend fun loadAd(adRequest: AdRequest, options: NativeAdOptions): NativeAdLoadResult

Start loading the native ad on a background thread.

Return

NativeAdLoadResult.Success with NativeAd or NativeAdLoadResult.Failure with com.yandex.mobile.ads.common.AdRequestError.

Parameters

adRequest

an AdRequest object contains targeting information used to fetch a native ad.

options

Configuration options for native ad loading. Default options load images automatically.